<?php

// -----------------------------------------------------------------------------

if (!isset($_GET['date'])) {
    exit("需要传入有效的参数");
}

$date = $_GET['date'];

// -----------------------------------------------------------------------------

include "DBManager.php";
include "config/config.php";

$db = new DBManager($dbPath);

// -----------------------------------------------------------------------------

try {
    if (empty($db->readFromTable($date))) {
        echo "当日记忆片段为空，无需删除。";
    } else {
        $db->deleteContent($date);
        echo "删除成功！";
    }
} catch (Exception $e) {
    echo $e->getMessage();
}
